import { markRaw } from 'vue';
import { RouteRecordRaw } from 'vue-router';
import RouterTransition from '@/components/routerTransition.vue';

const routeName = 'templates';

const routes: Array<RouteRecordRaw> = [
    {
        path: '/templates',
        name: routeName,
        redirect: '/templates/my',
        component: markRaw(RouterTransition),
        meta: {
            title: 'yl.templatesMgt',
            icon: 'LayoutFilled',
        },
        children: [
            {
                path: 'my',
                name: `${routeName}-my`,
                meta: {
                    title: 'yl.myTemplates',
                    icon: 'Me',
                },
                component: () => import(/* webpackChunkName: "templates" */ '@/views/templates/my/index.vue'),
            },
            {
                path: 'library',
                name: `${routeName}-library`,
                meta: {
                    title: 'yl.templatesLib',
                    icon: 'activity-source',
                },
                component: () => import(/* webpackChunkName: "templates" */ '@/views/templates/library/index.vue'),
            },
            {
                path: 'customer',
                name: `${routeName}-customer`,
                meta: {
                    title: 'yl.templatesCustomer',
                    icon: 'activity-source',
                },
                component: () => import(/* webpackChunkName: "templates" */ '@/views/templates/customer/index.vue'),
            },
            {
                path: 'classify',
                name: `${routeName}-classify`,
                meta: {
                    title: 'yl.templatesClassify',
                    icon: 'more-four',
                },
                component: () => import(/* webpackChunkName: "templates" */ '@/views/templates/classify/index.vue'),
            },
        ],
    },
];

export default routes;
